<?php
namespace app\admin\logic\mqlogic;

use app\admin\logic\ImportMoney;
use app\admin\logic\Transfer;
use app\admin\logic\transfer_driver\Ali;
use app\common\library\rabitmq\MqConsumerObject;
use FSLock\FSLock;
use think\exception\ValidateException;
use think\Log;

//处理导入众包费
class DelayExchangeConsumer extends MqConsumerObject
{
    public function __construct(array $config)
    {

        parent::__construct($config);
    }

    //消费者处理类
    public function run($message)
    {
        $message = json_decode($message, true);
        $type = $message['type'];
        try {
           if ($type == 1) {//阿里订单查询
                $order_sn= $message['order_sn'];
                Ali::instance()->query($order_sn);
           }
        }catch (\Exception $e) {
            $msg = $e->getMessage();
            Log::write('delayexchange:'.$msg);
        }

        return true;
    }

    public function __destruct()
    {
        parent::__destruct();
    }

}